package com.foreknow.demo5Exercise2;

import java.util.Scanner;

public class Test {

    public static void main(String[] args) {
        Scanner input =new Scanner(System.in);
        int i = 0;
        String begin = null;
        String lun = null;
        int npc = 0;
        String choice = null;
        Rule rule1 = new Rule();
        rule1.welcome();

        System.out.println("请选择对方角色( 1.刘备 2.孙权 3.曹操)：");
        npc = input.nextInt();
        rule1.name();
        do {
            System.out.println("要开始吗？(y/n)：");
            begin = input.next();
            while ("y".equals(begin)) {
                do {
                    i++;
                    rule1.choosenpc(npc);
                    System.out.println("要开始下一轮吗？(y/n)：");
                    lun = input.next();
                } while ("y".equals(lun));
                rule1.setTime(i);
                rule1.show();
                i = 0;
                break;
            }
            System.out.println("要开始下一局吗？(y/n)：");
            choice = input.next();
        } while("y".equals(choice));
        System.out.println("系统退出！感谢您的使用");
        System.exit(0);




    }

}
